<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html>
	<head>
		<%@ include file="/common/meta.jsp"%>
		<link type="text/css" href="<s:url value="/styles/cv_rc.css"/>" rel="stylesheet" />
        <script language="JavaScript"src="<s:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>		
        <script type="text/javascript" src="<c:url value="/js/czrc.js"/>" ></script>
<style>
	.ddbox{background-color:#e5ecf9;border-bottom:1px solid #bacddc;padding:2px 5px 2px 5px;font-size:110%;height:25px}
			  .fxtable{border: 1px solid #C1DAD7;width: 100%;margin-top:1px;}
			  .fxtable2{border: 1px solid #C1DAD7;width: 100%;margin-top:1px;}
			  .fxtable2 td.cls {border-right: 1px solid #C1DAD7;border-bottom: 1px solid #C1DAD7;background: #fff;font-size:12px;padding: 6px 6px 6px 12px;color: #4f6b72;}
		      .fxtable td {border-right: 1px solid #C1DAD7;border-bottom: 1px solid #C1DAD7;background: #fff;font-size:12px;padding: 6px 6px 6px 12px;color: #4f6b72;}
		        a.button{background:url(images/button.gif);	display:block;color:#555555;font-weight:bold;height:30px;line-height:29px;margin-bottom:14px;text-decoration:none;width:191px;}
				a:hover.button{color:#0066CC;}
		      .lens{ no-repeat 10px 8px;text-indent:30px;display:block;}
		      .fsg_nr{ position:absolute; display:none;top:25px; right:-3px; background:#fff; border:1px solid #98B1C8; }
		      .t10 { 
				    BORDER-RIGHT: #ffff00 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #ffff00 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #ffff00 1px solid; COLOR: #ffff00; PADDING-TOP: 5px; BORDER-BOTTOM: #ffff00 1px solid; HEIGHT: 20px; BACKGROUND-COLOR:#2f4f4f 
				} 
				.t10:hover { 
				    BORDER-RIGHT: #0000ff 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #0000ff 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #0000ff 1px solid; COLOR: #333333; PADDING-TOP: 5px; BORDER-BOTTOM: #0000ff 1px solid; HEIGHT: 20px; BACKGROUND-COLOR: #c8d8f0 
				}
</style>
	</head>

	<body>
	<s:form name="zsdwForm" id="zsdwForm" action='zsdw!preZsdw.do' method="post" >
	<input type="hidden" name="autodwdm" id="autodwdm" value=""/>
	<s:hidden name="dwid"></s:hidden>
	<s:hidden name="pname"></s:hidden>
	<s:hidden name="opttype"></s:hidden>
	
	<s:hidden name="zsdw.dwpassword"></s:hidden>
	<s:hidden name="zsdw.dah"></s:hidden>
	<s:hidden name="zsdw.isjfh"></s:hidden>
	<s:hidden name="zsdw.tdpc"></s:hidden>
 <!--个人信息 start-->
 <div style="width:100%">
 
		<div class="ddbox" id="grid_m_container" style="width:100%;height:40px;margin:5px;border: 1px solid #C1DAD7;overflow:auto">
				<b><font color="red">状态：</font></b>
				<b><font color="red">
					<span id="ztdiv">
					<s:if test="zsdw.sbbz==0">数据待报&nbsp&nbsp<a class="t10" href="javascript:dwSbDwinfo()"><b><font color="white">数据上报</font></b></a></s:if>
					<s:elseif test="zsdw.sbbz==1">数据已上报(等待审核)</s:elseif>
					<s:elseif test="zsdw.sbbz==2">数据审核通过&nbsp&nbsp<a class="t10" href="javascript:dwSbDwinfo()"><b><font color="white">数据上报</font></b></a></s:elseif>
					<s:elseif test="zsdw.sbbz==3">数据审核退回(原因：<s:property value="zsdw.thyy"/>)&nbsp&nbsp<a class="t10" href="javascript:dwSbDwinfo()"><b><font color="white">数据上报</font></b></a></s:elseif>
					</span>
				</font></b>
		</div>
		
	<div class="tableContainer" id="tableContainer" style="height:90%">
    	<table class="fxtable"  cellpadding="0">
			<tr>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px"><span class="red fn">*</span>单位类型</td>
				<td class="tdright"><s:select id="zsdw.dwlx" name="zsdw.dwlx" list="xtdict9" cssStyle="width:150" listKey="dictbh" listValue="dictname"  headerKey="" headerValue="--请选择单位类型--"/></td>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px"><span class="red fn">*</span>组织机构代码</td>
				<td class="tdright">
				<s:property value="zsdw.dwdm_8"/>-<s:property value="zsdw.dwdm_1"/>
				<s:hidden name="zsdw.dwdm"></s:hidden>
				</td>
				
			</tr>
			<tr>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px"><span class="red fn">*</span>单位名称</td>
				<td>
					<s:textfield id="zsdw.dwmc" name="zsdw.dwmc" cssStyle="width:150px"></s:textfield>
				</td>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:100px"></td>
				<td class="tdright">
					&nbsp;
				</td>
				
			</tr>
			<tr>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px">单位状态</td>
				<td class="tdright" colspan=3>
					<s:radio name="zsdw.dwzt" list="xtdict4" listKey="dictbh" listValue="dictname" value="zsdw.dwzt"></s:radio>
				</td>
			</tr>
			
			<tr>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px">法人代表</td>
				<td><s:textfield cssStyle="width:130px" name="zsdw.frdb"/></td>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px">成立日期</td>
				<td class="tdright"><input type="text" class="Wdate" name="zsdw.clrq" id="date" style="text-align:left;width:130" value="<s:property value="zsdw.clrq"/>" onfocus="new WdatePicker(this,'%Y-%M-%D')" MINDATE="1960-01-01" readonly/></td>
				
			</tr>
			
			<tr>
				
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px">内/外资</td>
				<td>
					<s:radio name="zsdw.nwz" list="xtdict5" listKey="dictbh" listValue="dictname" value="zsdw.nwz"></s:radio>
				</td>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px">注册资本</td>
				<td class="tdright"><s:textfield cssStyle="width:130px" name="zsdw.zczb" onfocus="javascript:this.select();" onblur="javascript:RC.isNum(this.id);"/><span class="red fn">(人民币/万元)</span></td>
				
			</tr>
			<tr>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px">办公地点</td>
				<td colspan=3>
				常州科教城
				<s:select name="zsdw.bgdd1" list="xtdict6" cssStyle="width:140" listKey="dictbh" listValue="dictname"  headerKey="" headerValue="--请选择--" />
				<s:select name="zsdw.bgdd2" list="xtdict7" cssStyle="width:50" listKey="dictbh" listValue="dictname"  headerKey="" headerValue="--选--" />
				座
				<s:select name="zsdw.bgdd3" list="xtdict8" cssStyle="width:50" listKey="dictbh" listValue="dictname"  headerKey="" headerValue="--选--" />
				层
				<s:textfield name="zsdw.bgdd4" cssStyle="width:50"></s:textfield>
				房间
				</td>
			</tr>
			<tr>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px">单位简介</td>
				<td colspan=3><s:textarea name="zsdw.dwjj" cols="55" rows="4"></s:textarea></td>
			</tr>
			
			<tr>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px">税务管理码</td>
				<td><s:textfield cssStyle="width:130px" name="zsdw.swglm"/></td>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px">纳税人识别号</td>
				<td class="tdright"><s:textfield cssStyle="width:130px" name="zsdw.nsrsbh"/></td>
				
			</tr>
			<tr>
				<td style="text-align:right;background:#E7F2FC;font:bold 12px 'lucida Grande',Verdana;width:130px">备注</td>
				<td colspan=3><s:textarea name="zsdw.sm" cols="55" rows="4"></s:textarea></td>
			</tr>
		</table>
	</div>
	</div>
	<div id="butdiv" style="width:770px;text-align:center">
		
		<s:if test="zsdw.sbbz==0 || zsdw.sbbz==3 || zsdw.sbbz==2">
			<input class="btn_submit1" type="button" value="保    存" onclick="javascript:doSave(1);"/>
			<input class="btn_submit1" type="button" value="保存并下一步" onclick="javascript:doSave(2);"/>
		</s:if>
		<s:else>
			<br>
			<b><font color=red size=3>正在审查中，请审批通过后打印书面材料盖章上报！</font></b>
		</s:else>
	</div>
	

	
	<div id='yjlbd' class="fsg_nr" style="display:none;width:360;height:210;">	
	<div loading='0' id='yjlbdd' style="width:360;height:190;background-color:#E7EAF7;overflow:auto;">
		<s:iterator value="xtdict13">
			<input type="checkbox" name="yjlb" id='yjlb<s:property value="dictbh"/>' value='<s:property value="dictbh"/>'/><span id='ch<s:property value="dictbh"/>'><s:property value="dictname"/></span><br>
		</s:iterator>
	</div>
	
	<div class="footer" style="background:#f5f5f5" style="width:360;height:20;text-align:right">
			<input class="button3" type="button" value="确  定" onclick="selTrue();"/>
		&nbsp&nbsp&nbsp&nbsp
	</div>
	<iframe src="javascript:false" style="position:absolute; visibility:inherit; top:0px; left:0px; width:100%; height:100%; z-index:-1; filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';"></iframe>
</div>	
	</s:form>
	</body>

	<script type="text/javascript">
		$('tableContainer').style.height = (getSize().h - 100)+"px"; 
		
		
		function ctrlDwdm(v){
			if(v=='007'){
				$('zsdw.dwdm').value='';
				if($('autodwdm').value == ''){
					var ajax = new AppAjax("zsdw!getAutoDwdm.do",function(data){
						$('zsdw.dwdm_8').value=data.autodwdm;
						$('autodwdm').value = data.autodwdm;
					}).submit();
				}else{
					$('zsdw.dwdm_8').value=$('autodwdm').value;
				}
				$('zsdw.dwdm_1').value='1';
			}else{
				$('zsdw.dwdm_8').value='';
				$('zsdw.dwdm_1').value='';
				$('zsdw.dwdm').value='';
			}
		}
		
		function dwSbDwinfo(){
			var ajax = new AppAjax("zsdw!doDwSbDwinfo.do?dwid="+$F('dwid'),sb_back).submit();
		}
		function sb_back(data){
			if(data.message.code >0){
				document.forms[0].submit();
				alert('数据上报成功');
			}else{
				alert(data.message.text);
			}
		}
		
		function doSave(type){
			
			if($('zsdw.dwlx').value.trim() ==''){
				alert('请选择单位类型！');
				return false;
			}
			
			if($('zsdw.dwmc').value.trim() ==''){
				alert('单位名称不能为空！');
				return false;
			}
			
			var ajax = new AppAjax("zsdw!doSaveZsdw.do",function(data){save_Back(data,type)}).submitForm("zsdwForm");
		}
		
		function save_Back(data,type){
			if(data.message.code >0){
				$('dwid').value=data.message.text;
				$('ztdiv').innerHTML = "数据待报&nbsp&nbsp<a class='t10' href='javascript:dwSbDwinfo()'><b><font color='white'>数据上报</font></b></a>";
				parent.reload = 1;
				if(type == 2){//保存下一步
					parent.setDwid(data.message.text,8,true);
				}else if(type==3){//填写完成
					parent.setDwid('',1,true);
				}else if(type==4){
					parent.closeWindows();
				}else{
					alert('保存成功!');
					parent.setDwid(data.message.text,1,false);
				}
			}else{
				alert(data.message.text);
			}
		}
		
		function selTrue(){
			$('yjlbd').style.display = 'none';
			var ych = RC.checkbox('yjlb');
			$('yjlbmc').innerHTML = '';
			for(var y=0;y<ych.length;y++){
				$('yjlbmc').innerHTML += $('ch'+ych[y].v).innerHTML +'&nbsp|&nbsp';
			}
		}
		
		function selZzxm(){
			parent.openWin("zsdw!getZsxmWaitSelect.do?pname="+$('pname').value,"650","400");
		}
		
		function setZzxm(id,mc){
			$('qzzxm.xmid').value=id;
			$('zzxm_button').value = mc;
		}
		
		function hgchecked(v){
			if(v=='1'){
				$('zsdw.hgtdpc').readOnly = false;
				$('zsdw.hgtdpc').style.background="white";
			}else{
				$('zsdw.hgtdpc').readOnly = true;
				$('zsdw.hgtdpc').style.background="#efefef";
				$('zsdw.hgtdpc').value="";
			}
		}
	</script>
</html>

